import 'package:aio/aio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:app/generated/app_strings.dart';
import 'package:app/src/http/bean/wroks/contract_bean.dart';
import 'package:app/src/http/bean/wroks/customers_copyInfo.dart';
import 'package:app/src/http/bean/wroks/oem_auditing_bean.dart';
import 'package:app/src/ui/app_ui.dart';
import 'package:app/src/ui/route/works/public/items/ui_base.dart';
import 'package:app/src/ui/route/works/public/items/ui_card.dart';
import 'package:app/src/utils/image_path_utils.dart';

///合同特殊设置，标签模板
class UiOemAuditing {
  ///data 客户信息
  ///oldData 历史客户信息
  static Widget build(
      BuildContext context, OemAuditing? data, OemAuditing? oldData,
      {String? title}) {
    if (StringUtils.isEmpty(data)) {
      return AppUi.getEmptyView();
    }
    if (StringUtils.isEmpty(title)) {
      title = AppStrings.of(context).TemplateTags; //模板标签
    }
    List<Widget> children = [];
    children.add(UiBase.title(context, title)); //fixme 标题
    children.add(UiBase.item(context, AppStrings.of(context).TemplateName,
        data?.TemplateName, oldData?.TemplateName)); //模版名称
    children.add(UiBase.item(context, AppStrings.of(context).CompanyName,
        data?.CompanyName, oldData?.CompanyName)); //销售公司（主）
    children.add(UiBase.item(context, AppStrings.of(context).CompanyNameEn,
        data?.CompanyNameEn, oldData?.CompanyNameEn)); //销售公司（副）
    children.add(UiBase.itemWithIcon(
      context,
      AppStrings.of(context).Logo,
      data?.Logo,
    )); //fixme 公司Logo
    children.add(UiBase.item(context, AppStrings.of(context).CustomerName,
        data?.CustomerName, oldData?.CustomerName)); //客户名称
    children.add(UiBase.item(context, AppStrings.of(context).CustomerAddress,
        data?.CustomerAddress, oldData?.CustomerAddress)); //客户地址
    children.add(UiBase.item(context, AppStrings.of(context).ProjectName,
        data?.ProjectName, oldData?.ProjectName)); //项目名称
    children.add(UiBase.item(
        context, AppStrings.of(context).Tel, data?.Tel, oldData?.Tel)); //电话
    children.add(UiBase.item(context, AppStrings.of(context).CompanyAddress,
        data?.CompanyAddress, oldData?.CompanyAddress)); //公司地址
    children.add(UiBase.item(context, AppStrings.of(context).CompanyAddressEn,
        data?.CompanyAddressEn, oldData?.CompanyAddressEn)); //公司地址（英）
    children.add(UiBase.item(
        context, AppStrings.of(context).Fax, data?.Fax, oldData?.Fax)); //传真
    children.add(UiBase.item(context, AppStrings.of(context).PostCode,
        data?.PostCode, oldData?.PostCode)); //邮编
    children.add(UiBase.item(context, AppStrings.of(context).WebSite,
        data?.WebSite, oldData?.WebSite)); //网址
    children.add(UiBase.item(context, AppStrings.of(context).ExecutiveStandard,
        data?.ExecutiveStandard, oldData?.ExecutiveStandard)); //执行标准
    children.add(UiBase.item(
        context, AppStrings.of(context).Bank, data?.Bank, oldData?.Bank)); //开户行
    children.add(UiBase.item(context, AppStrings.of(context).BankNo,
        data?.BankNo, oldData?.BankNo)); //开户行账号
    children.add(UiBase.item(context, AppStrings.of(context).TaxId, data?.TaxId,
        oldData?.TaxId)); //公司税号
    var column = UiBase.column(context, children);
    var card = UiCard.build(context, column);
    return card;
  }
}
